from flask import Flask,abort, redirect, url_for,request
app = Flask(__name__)

@app.route('/')
def index():
    user_agent = request.headers.get('User-Agent')
    return '<p>Your browser is %s</p>' % user_agent

@app.route('/hello')
def hello():
    return 'Hello World'

@app.route('/hello1')
def hello1():
    return '<h1>Hello World!</h1>'


@app.route('/user/<username>')
def show_user_profile(username):
    # show the user profile for that user
    return 'User %s' % username

@app.route('/post/<int:post_id>')
def show_post(post_id):
    # show the post with the given id, the id is an integer
    return 'Post %d' % post_id

@app.route('/projects/')
def projects():
    return 'The project page'

@app.route('/projects')
def projects2():
    return 'The project222 page'

@app.route('/about')
def about():
    return 'The about page'

@app.route('/redirect1')
def redirect1():
    return redirect(url_for('redirect2'))

@app.route('/redirect2')
def redirect2():
    return "redirect 222222"

if __name__ == '__main__':
    app.debug = True
    app.run()